Move linked libraries into LDLIBS

Change-Id: I78cff16d3f1ee1926721156df585071659dfafc8