Our pre health advisor has told us to take a professor out to a thank you lunch once a semester, and this advice has been really helpful. I'm often awkward around intellectual professors and over think all of my words in an office setting, which makes my motives look general and unappealing. However, the two professors that I've really enjoyed this last year, I ask them out to lunch with a few, maybe two, friends at the last class. Eating definitely opens a professor up, especially if you offer to foot the bill. Afterwards, your relationship with the professor becomes much more easy going, and I think it shows that you see them as a good advisor and want to continue a relationship past this class. I think it's sort of rude when you have a professor and contact them months later for a rec, even though you've made no effort to continue a relationship, so kudos to you for wanting to do more than just yank a rec out of him or her!