cut to dirs, rewrite Makefile