Improve out directory structure and cleanup main.mk