Use -rpath-link instead of -L in LDFLAGS