tcmode: use gcc -dumpversion for the version prefix

Also fix duplicate trailing % for the fallback.

Signed-off-by: Christopher Larson <chris_larson@mentor.com>