change cloning commands in makefile to correctly obtain tags and branches, make backward compatible with older versions of git, add sanity checks to ensure that the correct git branch/tag is obtained