Make cmd/m more robust

In case of a target like 'make src/clean', take $(basename $target)
before trying to build the name of the logfile.  This is still not
perfect, as it may fail for a file name with spaces.

modified:   cmd/m