Handle fopen errors
Expanded makefile