Makefile tweaks

Replace some Makefile commands with variables in py/mkenv.mk