make gdal lib check more robust