Makefile improvement

Rebased pull request #6435 (which contains #6434 and the split echo statements).
Removed the prefix of newly introduced commands.