Streamline the compilation

Fixes an unsigned-signed comparison and autocreates directory for object files.