Replace autoconf with ctypes

HAVE_funcname for functions and USE_libname for
libraries.