Pour 1 tbsp oil into a large saucepan. Add the onion, carrot, and a pinch of salt. Cook gently, stirring for 10 mins until soft.
Add the garlic and thyme to the pan. Cook for 1 min then stir in the tomato purée and cook for a min more. Add the lentils, mushrooms and tomatoes. Bring to the boil, then reduce the heat and leave to simmer with a lid on.
Add in the Marmite and continue to cook the ragu, stirring occasionally, over a low-medium heat for 30-45 mins until the lentils are cooked and the sauce is thick and reduced, adding extra water if necessary.
Cook the spaghetti in a large pan of salted water for 1 min less than packet instructions. Drain the pasta, reserving a ladleful of pasta water, then toss the spaghetti in the sauce, using a little of the starchy liquid to loosen up the ragu slightly so that the pasta clings to the sauce. Serve topped with fresh basil and some black pepper.