[mcs/build] Use make functions instead of calling a shell