Amazon linux deps

Reworked the dependency installation a bit to provide support for Amazon Linux (hopefully without breaking CentOS/RHEL in the process). Not really sure if this is the best way to do it.