System command 'make' failed. Models won't compile

I had a similar error when trying to run rethinking::ulam() or cmdstanr::cmdstan_model():

I would get:

Compiling Stan program...
Error in `(function (command = NULL, args = character(), error_on_status = TRUE, …`:
! System command 'make' failed
---
Exit status: 2
Stderr:
make: *** /c/Users/first-last/OneDrive: Is a directory.  Stop.
Type .Last.error to see the more details.

Like you, I was able to fix the issue by deleting one of two folders that started with “OneDrive”
C:\Users\first-last\OneDrive Deleted (It was empty)
C:\Users\first-last\OneDrive - MMC Kept (had OneDrive files in it)

However, I cannot figure out why the Stan program wanted to look in that path. My working directory, R libraries, and cmdstanr installation were set elsewhere, like C:\cmdstanr\cmdstan-2.32.2.