Use pkg-config to improve dependency detection

Closes #4324
Closes https://github.com/postgis/postgis/pull/372



git-svn-id: http://svn.osgeo.org/postgis/trunk@17233 b70326c6-7e19-0410-871a-916f4a2858ee
1 job for svn-trunk in 29 minutes and 46 seconds (queued for 2 seconds)
Status Job ID Name Coverage
  Test
passed #159651722
test

00:29:46