There might be a fix for this in the Github version of Rstan: Error in if (grepl(pattern, makefile_txt[i]))
Depending on how much of a showstopper this is, you could try installing from Github as described here: https://github.com/stan-dev/rstan/wiki/Installing-RStan-from-source-on-Windows . I don’t see the issue (https://github.com/stan-dev/rstan/issues/634) marked as fixed though, so your mileage may vary there.
@Slawek_Smyl reported that this wasn’t an issue with the Ubuntu version, if you have access to an Ubuntu install.