Can't compile simple stan code on M1 MacOS Ventura

Here is the output:

clang -v
clang version 5.0.1 (tags/RELEASE_501/final)
Target: x86_64-apple-darwin22.6.0
Thread model: posix
InstalledDir: /usr/local/bin
xcode-select -p
/Applications/Xcode.app/Contents/Developer
xcode-select -v
xcode-select version 2397.
total 0
lrwxr-xr-x  1 root  wheel   14 Jul 28 18:24 MacOSX.sdk -> MacOSX13.3.sdk
drwxr-xr-x  7 root  wheel  224 Jul 28 18:24 MacOSX12.3.sdk
lrwxr-xr-x  1 root  wheel   14 Jul 28 18:23 MacOSX12.sdk -> MacOSX12.3.sdk
drwxr-xr-x  7 root  wheel  224 Nov 12  2022 MacOSX13.1.sdk
drwxr-xr-x  7 root  wheel  224 Mar  9 19:58 MacOSX13.3.sdk
lrwxr-xr-x  1 root  wheel   14 Jul 28 18:22 MacOSX13.sdk -> MacOSX13.3.sdk