Lufthansa reaches deal with pilots to cut costs