Improve shell portability of new rules in Makefile.shared.