configure: re-arranged compiler detection calls to see if this solves error on Mac