In the cuda m4 macro, LIBS was saved instead of LDFLAGS, but then restored to LDFLAGS. Now, save LDFLAGS to restore to LDFLAGS afterwards.