configure: Use cppflags check helper functions where appropriate