the first two are entirely encapsulated systems and really can't be the problem.
Medicare is paid for by a 2.9 percent tax on income. Fixing it's budget problem of changes in demographics can't be that hard.
Similarly, social security is basically a pay as you go system that is dealing with a demographic shift. You just change to change the tax or benefit replacement rate (fraction of tax paid out per year) and it's fixed.
Defense on the other hand is a problem. I think that if the US spent less on defense our allies would be forced to spend more and we'd also become more competitive for exports. When the U.S. attacked Libya, we had wars going in two theaters and were still able to provide overwhelming force. Meanwhile, several European countries contributions were assets like 2 F-15s 3 weeks into the conflict. This is because that's what their defense plan calls for, for them to have 2 F-15s ready for combat within a month.
Basically, the U.S. is sponsoring all the European socialism via our defense spending because these countries simply don't have to spend money on defense.