Oh my, how did you end up buying a ticket on Air Madrid? Are you aware that the Spanish authorities have initiated proceedings against that airline and may withdraw their air operating certificate in the coming days for serious violations of safety and other norms? The most recent newspaper article from the Spanish press can be found
here.
Air Madrid has had severe operational problems in the last few months, with flights frequently being delayed for multiple days (!), aircraft being grounded by the authorities, etc.
I do not believe that Lufthansa would interline bags to Air Madrid, but have no first-hand experience of that.