configure: use correct cflags in compiler checks