Simplest way is no Lockerbie bombing.
Before the bombing, they had their most profitable quarter ever. Because of the bombing, they had to pay a massive settlement, sell off their most profitable route (JFK Heathrow), and deal with much lower numbers of passengers, mainly scared off by the bombing. Without all that, it quite plausible Pan Am could have survived, possibly even buying out a few of the other majors (they nearly bought Northwest, but didn't have the cash after Lockerbie).