Autodetect dependencies and add override flags

Closes #9