configure.ac: Rename AM_LDFLAGS to LTLDFLAGS and actually use them