My aunt - a professor of musculoskeletal anatomy here in Australia - has developed a programme called Onero[1] specifically to deal with this question. I've done a bit of general IT work to help her recover from her tech partner going AWOL (classic startup story) and have watched people participate in it. It was weird at first to see old people - 80+ - in a gym, pumping iron. But they really got into it and from what I can glean from talking to my aunt the difference is pretty amazing.
The programme is starting to be picked up by practitioners globally - though it's more common here in Australia for the moment. There are online versions of the courses as well.
It's repeating what the GP said, but: exercise. Your bones are strengthened by use -- put them under mild stress by doing load-bearing exercise and they'll get stronger.
(Getting plenty of calcium and vitamin D probably helps, but there's a lot of argument about whether supplements actually work there.)
I thought it would be in the article, but it only mentioned muscle mass. I believe lifting weights actually improves bone strength as well, but I don't have the references available that say that.