Hi asiamj . Ive had trouble with my hamstrings riding to . I actually buggered them for about 3 months from pushing them too hard. I'd suggest doing some more stretches when you're not riding and I recommend seeing a physio before it becomes a big problem. They'll probably suggest you do a lot more stretching and they'll probably give you a stretching program. Once your hamstrings are more flexible you'll be far less injury prone and will notice a difference in performance
Hope that's helpful