build: move -rdynamic to AM_LDFLAGS

The -rdynamic option is for the linker, and clang correctly complains
that we're including it in CFLAGS instead of LDFLAGS.