fixed order for external library inclusion and added mpi libs to make it link for any situation (where dependencies that use mpi do not have mpi libs in their interface libs)