I've done the following..

#vim Makefile.am

Enter things like -lm -lstdc++ -lssl -fpermissive and such I've not needed in the past

:wq

..more than I care to think about, today.