Here's one good exercise you can do for muscle memory. Hold The F chord for 2 seconds, then release while extending your finger a little bit (so that you don't keep your finger into the chord position) wait 1 second then make the chord again. Do this about 15-20 times. Then leave it for 10 minutes and work on something else. When you come back to the exercise, instead of extending your fingers, lay your hand on your lap 1 second then make the chord again.
I'm a very strong believer in visualisation. While your hand travels from your lap to the fret board, visualise your finger. Think about which fingers goes where.
After a while you won't have to think about it and they will position themself naturaly.