To make pesto, place spinach, garlic and pistachio in a blender or food processor. With the motor running, slowly pour in olive oil and process until finely pureed. Season with salt and pepper and set aside.
In a large deep saute pan, heat oil over medium high heat. Add mushrooms and thyme and cook a few minutes on each side until golden. Add white wine and cook a few minutes longer until wine slightly reduces and then stir in parmigiano.
Add cooked spaghetti, pesto, lemon juice, reserved pasta water and gently toss until pasta is well coated.
Serve immediately garnished with fresh thyme leaves and parmigiano.