Honor CC, CFLAGS and LDFLAGS in configure script.

This allows feature detection when compiling w/o gcc (ie cross compiling)