In a food processor, pulse the mushrooms with garlic and thyme until finely chopped and well combined.
In a medium skillet, pre-heat 1 tablespoon of olive oil over medium heat. Cook the onions for about 15 minutes, stirring occasionally, until golden brown. Stir in the mixture from the food processor; cook for 2 or 3 minutes more until liquid evaporates and remove from heat. Let cool.
Add the lentils into a large bowl; stir in the mushroom mixture; add bread crumbs, egg and salt, mix well. Moisten your hands and form 8 patties (take about ½ cup of the mixture per patty). Add the cornmeal into a plate and evenly coat the patties on both sides.
In a non-stick skillet, pre-heat the olive oil over medium heat. Cook patties for about 3 minutes on one side until golden brown. Flip the patties over; cover each with cheese. Cook for another 3 minutes or enough to let the cheese melt. Top the burgers with tomato slices and basil leaves (if desired), place between whole-grain buns and serve.