The *config.h files I referred to are the autoconf-generated config.h, hconfig.h, tconfig.h, and auto-config.h in the gcc build directory. For example, in auto-config.h replace #define HAVE_STDLIB_H 1 with #include <stdlib.h>