From the information that you have provided, I seems that you are currently suffering from atrophy and weakness of the lower extremity due to prolonged immobilisation. The best way to deal with this at this present time would be aggressive physical therapy with stretching and strengthening exercises. Physical therapy of lower extremity will strengthen the muscles around the joints and will take off load from the joints and thereby, will lead to decrease in clicking sounds that you are hearing. If the clicking in the knees persists even after the course of physical therapy, an MRI of the knee would be the next way to go.