Thanksgiving comes to us out of all the prehistoric dimness, universal to all ages and all faiths. At whatever straw we must grasp, there is always a time for gratitude and new beginnings.
If the heart wanders or is distracted, bring it back to the point quite gently -- and even if you do nothing during the whole of your prayer but bring your heart back, though it went away every time you brought it back, your time would be very well employed.