scripts/gen-versionh.sh: rework VER definition (less programs spawned)

Signed-off-by: Samuel Martin <s.martin49@gmail.com>
scripts/gen-versionh.sh: fix indentation

Signed-off-by: Samuel Martin <s.martin49@gmail.com>
scripts/gen-versionh.sh: cleanup git check

Signed-off-by: Samuel Martin <s.martin49@gmail.com>
scripts/gen-versionh.sh: fix VER definition

Correctly check that the git program exists and the sources actually are in
a git repository.

Also simplify/invert the the logic git check logic.

Signed-off-by: Samuel Martin <s.martin49@gmail.com>