Spatial libraries fixed

When building [libosmium](https://github.com/osmcode/libosmium) examples under MSYS2 I noticed some bugs in newly added spatial packages (libspatialite, gdal and geos). Th edetailed descriptions are in comments.
This may be a hack, but current configure.ac and makefile.am does not mention iconv library (which is certainly needed by shell.c, it has ``#include<iconv.h>`` ). I hope it is OK to just add this libray to the flags.