[PATCH v2] Makefile: fix generating environment file