Create output directories in Makefile
Fix Makefile directory creation
Fix JPEG markers detection