Added a clean target for the Makefile and made the code more idiomatic