Pour the olive oil into a pan to brown the onion and garlic.
Add in all tomatoes and tomato paste. Then add salt, pepper, and thyme. Stir and cook for 10 minutes. Set aside.
Melt the butter in another pan, add the flour, and stir. Then add the milk and stir to avoid lumps. Add salt, pepper, and nutmeg. Mix and set aside.
Spread some of the white sauce at the bottom of a casserole and build the lasagna. First a layer of cheese, ham, and tomato sauce; then a layer of lasagna sheets. Repeat the layers alternating the red sauce and the white sauce. Finish with a layer of white sauce and cover it with parmesan.
Bake for 1 hour at 180° C until the cheese is browned.