It is very unlikely that hamstring is preventing you from squatting properly. Hamstring is nowhere near the end of it's range of motion in squat because it crosses both knee and hip joint and knee is bent during the squat - therefore hamstring is not considerably stretched.
Ankle flexibility is more frequent cause of not being able to squat properly. Hips also, but not because of hamstring.
Ankle flexibility is more frequent cause of not being able to squat properly. Hips also, but not because of hamstring.