configure: Now more compatible with autoconf

* Fix prefix handling

  - now setting --foodir (mandir, bindir, ...) adds the --prefix only if the
    value does not start with slash (i.e. local path)

* Add a few compatibility options, i.e. infodir, sysconfdir, etc.

* Move -fPIC and -pthread to config.mk so that it's not overridden by
  CFLAGS from the build system

Signed-off-by: Cyril Hrubis <metan@ucw.cz>