I had surgery on a left ankle tendon to remove a cyst. The tendon was cut during surgery because the cyst was deeper than the sleeve/outer casing of the tendon. As you can imagine, I can be unstable. The surgeon wanted me to wear high heels on occasion to help straighten my ankle and the ability to stabilize it. My ability to balance in super high heels was my test of when I was allowed to go back on the ice. Unfortunately, I developed a severe allergic reaction called Serum Sickness to the antibiotic that prevented me from returning for several months . . . .
I don't know if ankle or knee joints are actually weak, but the surrounding muscles and joining tissues may have issues. Isometric exercises, weights while bending, probably would increase stability. How about Yoga?