Try setting SDKROOT explicitly to the system SDK:
export SDKROOT=$(xcrun --sdk macosx --show-sdk-path)