Use fallback in configure when pkg-config is not available

When pkg-config is not available on the system, look for ncurses and
libconfig via AC_CHEKC_HEADER / AC_CHECK_LIB as a fallback.