Add Makefile
Fix 404 handling and test (fixes #4)