Move the EXTRALIBS to the end of the link line where they actually get used!