Heat the oil or water in a large pot over medium heat. Add the onion and cook until softened, 5 minutes. Add the garlic, red pepper flakes, and thyme, and cook until fragrant, 30 seconds. Stir in the broth and wine, increase the heat to high, and bring to a boil. Add the lentils, reduce the heat to a simmer, and cook, partially covered, for 20 minutes.