Most people didn't used to live beyond the age where they were able to work. Now the majority do.
A potential solution is having a cultural shift away from debt fueled consumerism towards frugality and saving. Hopefully, this will be encouraged by the widespread adoption of Bitcoin and HODL mentality.
The other way is having a cultural expectation for children to take care of their aging parents, definitely not an easy sell in the West nowadays.
Either way, can't be fixed quickly nor easily.
Only a economic depression can do that.