Make sure directory exists before building an object file