Buildsystem cleanup

Some small cleanups on the configure script:
- AC_SEARCH_LIBS does what we want in less lines
- AC_CHECK_TYPE now accepts headers to include
- AC_ISC_POSIX is long deprecated

That's it for now, it's a bit late for digging ncurses.