build: unbreak configure with python 2.6
Commit 2b1c01c2 ("build: refactor pkg-config for shared libraries") from May 2015 introduced python 2.7-specific code.
It mainly affects people building on old RHEL platforms where the system python is 2.6. Seemingly a dying breed because the issue went unnoticed (or at least unreported) for a whole year.
Fixes: #6711 (closed)