build: tweak generate-version.sh to work with older Git