update makefiles

Makefiles now create output directories if not already present
and delete them when running "make clean".