1) Sleep in fetal position on a firm-ish mattress
2) Upon waking up, get onto floor, lay on back with knees bent up for 5-10 min
3) Stretch hamstrings regularly
FWIW my wife conned me into going to the gym with her once. I used the elliptical and was like a cripple the next day.

I'll stick to calisthenics.