Heat oil over medium-high heat in a large pot. Add mustard seeds, cumin seeds and curry leaves (if using) and cook until the seeds begin to pop, about 20 seconds. Add onion, chile, ginger and garlic and cook, stirring occasionally, until the onion is starting to brown, about 5 minutes.
Add bay leaf (if using), water, lentils, coconut milk, salt and turmeric to the pot. Bring to a boil, stirring frequently to make sure the lentils don't stick to the bottom. Add squash, cauliflower and potato; return to a boil. Reduce heat to a simmer and cook, uncovered, stirring occasionally, until the vegetables are just tender when pierced with a fork, 20 to 25 minutes.
Remove from heat; stir in garam masala and lime juice.
