configure: add optional pkg-config helper and use it.