You state that you
need to install the source version of terra to use the INLA package (the binary version is not compatible).
That is almost certainly not true. Where did you get that idea?
If I do
install.packages("terra")
install.packages("INLA",repos=c(getOption("repos"),INLA="https://inla.r-inla-download.org/R/stable"), dep=TRUE)
All works as expected.
The reason that this is not working for you is that you are using an ancient version of Rtools and probably also of R.