Added libpq linking and device routes