Read these two threads first:
(Your flight to MAD)
http://www.flyertalk.com/forum/iberi...ve-thread.html
(your flight to JFK)
http://www.flyertalk.com/forum/iberi...ve-thread.html
Then read the threads on the lounges.
On what basis do you feel the flights will be crap? The flight to Madrid has one of the best seats and service around, the flight to JFK has a flatbed like the Qantas seat and service is better than AA (imo). Flights will be on Airbus A320 and A340.