As a rule, anyone encountering hamstring problems should do a lot of Glutes recruitment drills. It's very easy, you lay on your tummy and fire each one up individually one at a time. The idea is to snap from 0-100% in the shortest possible time without any other muscles kicking in. The number of reps you do is not as important as the quality, always remember to relax off fully after every activation. 3mins on each side twice a day.
After a couple of weeks you can move to stage 2. After the squeeze don't let go, but tense the quads in the same way, then release the quads without releasing the glute, then release the glute. so: glute-quad-quad release-glute release. After a couple of months of this you should be able to do it in your sleep and your hamstring should have got better. Try friction massage with a lacrosse ball on your hamstring, 4mins every 4 days, the 4 day wait is for your body to clear out the inflammation from the 4mins and it matters that you wait- less is more.