Fix current directory detection in Makefile.in PWD is set from "$(shell pwd)" which didn't work reliably. Use the variable CURDIR instead which exists for this purpose.
Allow overriding version description Makefile.in has provisions to allow setting the version description, ref and hash values through environment variables. However, if it detects the source directory being a git repository, it will overwrite these values again. As a quick fix just remove the git check.