config: fix --as-needed vs sincos build problem
config: fix --as-needed vs sincos build problem

LDFLAGS=-Wl,--as-needed ./configure would fail to detect sincos.  Worse,
under some gcc versions the replacement sincos would be optimized by gcc
into a call to the function sincos, which led to a recursive crash on
that platform.

By putting the math library in LIBS instead of LDFLAGS, it comes after
the source file.  With --as-needed AND when -lm was specified before the
source file, the linker legitimately could omit the math library,
leading to the "undefined symbol 'sincos'" error that configure detected
in the test.

ArcEye/machinekit-testing,ikcalB/linuxcnc-mirror,EqAfrica/machinekit,RunningLight/machinekit,jaguarcat79/ILC-with-LinuxCNC,mhaberler/machinekit,bobvanderlinden/machinekit,aschiffler/linuxcnc,bobvanderlinden/machinekit,ArcEye/MK-Qt5,Cid427/machinekit,araisrobo/linuxcnc,unseenlaser/machinekit,RunningLight/machinekit,bmwiedemann/linuxcnc-mirror,ArcEye/MK-Qt5,araisrobo/linuxcnc,ArcEye/machinekit-testing,cdsteinkuehler/linuxcnc,cnc-club/linuxcnc,aschiffler/linuxcnc,ArcEye/MK-Qt5,jaguarcat79/ILC-with-LinuxCNC,Cid427/machinekit,bobvanderlinden/machinekit,araisrobo/machinekit,narogon/linuxcnc,cdsteinkuehler/linuxcnc,cdsteinkuehler/linuxcnc,mhaberler/machinekit,mhaberler/machinekit,mhaberler/machinekit,kinsamanka/machinekit,ianmcmahon/linuxcnc-mirror,RunningLight/machinekit,ArcEye/MK-Qt5,RunningLight/machinekit,mhaberler/machinekit,cnc-club/linuxcnc,EqAfrica/machinekit,araisrobo/machinekit,aschiffler/linuxcnc,cdsteinkuehler/MachineKit,EqAfrica/machinekit,kinsamanka/machinekit,ianmcmahon/linuxcnc-mirror,narogon/linuxcnc,araisrobo/machinekit,ianmcmahon/linuxcnc-mirror,strahlex/machinekit,cnc-club/linuxcnc,cnc-club/linuxcnc,strahlex/machinekit,kinsamanka/machinekit,mhaberler/machinekit,Cid427/machinekit,cdsteinkuehler/MachineKit,ArcEye/machinekit-testing,cdsteinkuehler/MachineKit,bmwiedemann/linuxcnc-mirror,RunningLight/machinekit,bobvanderlinden/machinekit,RunningLight/machinekit,ikcalB/linuxcnc-mirror,Cid427/machinekit,bobvanderlinden/machinekit,cdsteinkuehler/MachineKit,mhaberler/machinekit,ArcEye/MK-Qt5,unseenlaser/linuxcnc,ikcalB/linuxcnc-mirror,mhaberler/machinekit,bmwiedemann/linuxcnc-mirror,ArcEye/MK-Qt5,ianmcmahon/linuxcnc-mirror,ArcEye/machinekit-testing,araisrobo/machinekit,jaguarcat79/ILC-with-LinuxCNC,bmwiedemann/linuxcnc-mirror,EqAfrica/machinekit,bmwiedemann/linuxcnc-mirror,ikcalB/linuxcnc-mirror,RunningLight/machinekit,araisrobo/machinekit,araisrobo/machinekit,unseenlaser/machinekit,cdsteinkuehler/linuxcnc,ArcEye/MK-Qt5,cnc-club/linuxcnc,narogon/linuxcnc,bobvanderlinden/machinekit,araisrobo/machinekit,strahlex/machinekit,aschiffler/linuxcnc,unseenlaser/linuxcnc,EqAfrica/machinekit,unseenlaser/linuxcnc,Cid427/machinekit,ArcEye/MK-Qt5,unseenlaser/machinekit,ianmcmahon/linuxcnc-mirror,Cid427/machinekit,ianmcmahon/linuxcnc-mirror,bobvanderlinden/machinekit,unseenlaser/machinekit,ianmcmahon/linuxcnc-mirror,ArcEye/machinekit-testing,aschiffler/linuxcnc,kinsamanka/machinekit,unseenlaser/linuxcnc,narogon/linuxcnc,araisrobo/linuxcnc,kinsamanka/machinekit,RunningLight/machinekit,cnc-club/linuxcnc,cdsteinkuehler/linuxcnc,araisrobo/machinekit,ArcEye/machinekit-testing,kinsamanka/machinekit,unseenlaser/machinekit,strahlex/machinekit,cdsteinkuehler/MachineKit,unseenlaser/machinekit,bobvanderlinden/machinekit,EqAfrica/machinekit,EqAfrica/machinekit,kinsamanka/machinekit,ArcEye/machinekit-testing,Cid427/machinekit,Cid427/machinekit,araisrobo/linuxcnc,jaguarcat79/ILC-with-LinuxCNC,cdsteinkuehler/MachineKit,ikcalB/linuxcnc-mirror,ArcEye/machinekit-testing,strahlex/machinekit,cnc-club/linuxcnc,bmwiedemann/linuxcnc-mirror,unseenlaser/machinekit,unseenlaser/linuxcnc,unseenlaser/machinekit,ikcalB/linuxcnc-mirror,kinsamanka/machinekit,cdsteinkuehler/linuxcnc,strahlex/machinekit,strahlex/machinekit,EqAfrica/machinekit,araisrobo/machinekit,araisrobo/linuxcnc,jaguarcat79/ILC-with-LinuxCNC,narogon/linuxcnc,ikcalB/linuxcnc-mirror,bmwiedemann/linuxcnc-mirror