I had the same problem -- reversed first and last names -- on an itinerary involving TG/CI/DL/KLM flights. I booked on a Spanish website and mistook the nombre/appellido. Best thing to do is to go to the airline company (ies) and try to correct problem. Depending on who the ticket issuer is, they may be able to correct the problem without difficulty. The other airlines will not touch the problem, and you have to get the ticket issuer airline to advise other airlines involved that your correct first/last name is the same pax as last/first name pax on ticket.
The airline may also tell you to get the travel agent to reverse the names but if foreign agent, they may not understand what your problem is.
So the best solution/work around is go to ticket issuer airline, and work with them to resolve the problem. If only one airline involved, it should be an easy problem to solve, but have all documentation between you and airline at hand when you check in.