Get those glutes working! Hamstring strains can result from underactive glutes. This is by far the most common reason I see and was the reason I had a history of hamstring pulls.
Another big thing with hamstring pulls, at least for me, is when you think you're ready to get after it again, wait a week. This injury is notorious for lingering around because people try to come back too soon. Take care of it right the first time so you don't have to deal with it for 3 months, if not longer.