Fix problems building jasper and gdal

- changed gdal build script to avoid an error related to config.rpath
- added two configure parameters for gdal so it finds and links to the right libpq and finds libjasper
- changed the lib jasper download location to the one provided by gdal. They use a modified version, see http://trac.osgeo.org/gdal/wiki/JasPer for details (thanks to @kashif)