Heat the olive oil in a large skillet over medium high heat. Add the ham and cook for 3 to 4 minutes, stirring often, until browned. Add the onion, garlic, salt and pepper and cook for another 3 to 4 minutes or until the onion has softened.
Push the ham/onion mixture off to one side of the skillet and then add the spaghetti, breaking it in half while you add it to the skillet.
Using tongs, toss the pasta carefully until it's toasted for about 5 minutes, then add the wine to deglaze the pan.
Pour in the chicken broth and toss the pasta again combining it with the ham then cover and simmer for 10 minutes over medium heat.
Next stir in the beans, peas, Parmesan and thyme; cover and cook for 10 minutes more.
Stir the pasta once more so that all ingredient are mixed together.
Sprinkle in more Parmesan (if desired), and garnish with parsley.