gen-versionh.sh: make it work with sources from a git-archive

Hi,

This short series does some cleanup of the bash gen-versionh.sh script and fix it to work properly when the source tarball has been generated with git-archive.

Regards,

Samuel