Use $(shell :; ...) in Makefile to force shell
Did you think that `$(shell command -v ...)` would actually get run by
the shell? Foolish mortal; GNU Make is obviously far more wise than
thee, as it optimizes it to a direct -- and hence broken (since
`command` is a shell builtin) -- exec. This horrifying contortion
ensures that an actual shell runs the command and fixes the behaviour.
@Shizmob found the source of this misbehaviour; turns out gmake has a
hard-coded, incomplete list of shell builtins:
https://github.com/mirror/make/blob/
715c787dc69bac37827a7d6ea6d40a86c55b5583/src/job.c#L2691
This contains `command`, but the whole function is full of horrible
heuristic garbage so who knows. I'm so sorry.