Create output directory if it doesn't exist

Currently if you pass `lib/file.c`, you get an error because the `build/out/lib` directory doesn't exist.