The farmer I used to work for was an expert thumper, but I could never completely get the hang of it.
For melons, look for a tendril that comes out of the vine right at the base of the fruit's stem. When that turns brown and dry, the fruit is ready to go. Pumpkins I like to leave on longer, at least until the stem starts turning brown, and if I plan to store them, I'll actually let the whole vine die before my big harvest.