As you noted, I said that the problems stems from sudo not setting PWD, hence `sudo make` doesn't inherit PWD. I'm not calling that a bug in sudo, but it was a bug in the specific makefile which assumed PWD to be set always.
A good solution to the problem is for make to set the PWD macro. BSD make already does this.
> It can get if from the environment like every application does
Well no, applications either read an environment variable or use getcwd(2).