Lufthansa and Air Europa both operate out of T1 in MAD, which should save you a bit of time. I had a connection in MAD a few weeks ago and had to go from T1 to T4, which is quite a trek (although the new T4 is a fantastic building).
I would always recommend taking the latest flight possible. Remember that because you're flying on two separate itineraries, Air Europa is under no obligation to help you out if you miss the flight because your Lufthansa flight was delayed. Probably not worth the risk, no matter how minor it is.