Make sure we pass autotools CXX and CC to cmake

Should hopefully fix compilation issues with travis-ci.