Build: configure: move __progname check to libraries section
... instead of headers, which it has nothing to do with.
Also, improve formatting, and don't cache the value (cacheing is off by default
because it can get outdated after system software upgrades, which is a good
reason not to use it).