Makefile.am: Support building in a separate build dir & static linking
Makefile.am: Support building in a separate build dir & static linking

Building rabbitmq-c involves building sources too, which are then to
be used by other parts of the code. These built sources end up being
placed under the build directory, not the source. For this reason,
lets update the Makefile.am, so that AM_CFLAGS includes both
$(top_srcdir)/librabbitmq and $(top_builddir)/librabbitmq. Then,
everything that sets any kind of CFLAGS, also has to be updated to
include $(AM_CFLAGS), as to not override it.

While there, also shuffle around a few LDADDs, because with static
linking, librabbitmq.la needs to come last, so that the symbols
tools/libcommon.la uses from it will be found by the linker.

Signed-off-by: Gergely Nagy <6780fac3b38619ac20422286e4110a70dbba2203@madhouse-project.org>

chenwenbin928/rabbitmq-c,tempbottle/rabbitmq-c,Haster2004/rabbitmq-c,chenwenbin928/rabbitmq-c,jqk6/rabbitmq-c,hjzljp/rabbitmq-c,jasonmsoft/rabbitmq-c,soindy/rabbitmq-c,jasonmsoft/rabbitmq-c,alanxz/rabbitmq-c,hjzljp/rabbitmq-c,tempbottle/rabbitmq-c,jqk6/rabbitmq-c,jasonmsoft/rabbitmq-c,soindy/rabbitmq-c,tempbottle/rabbitmq-c,soindy/rabbitmq-c,hjzljp/rabbitmq-c,chenwenbin928/rabbitmq-c,Haster2004/rabbitmq-c,alanxz/rabbitmq-c,jasonmsoft/rabbitmq-c,kilinrax/rabbitmq-c,sakishum/rabbitmq-c,sakishum/rabbitmq-c,jqk6/rabbitmq-c,kilinrax/rabbitmq-c,alanxz/rabbitmq-c,jqk6/rabbitmq-c,sakishum/rabbitmq-c,hjzljp/rabbitmq-c,Haster2004/rabbitmq-c,tempbottle/rabbitmq-c,kilinrax/rabbitmq-c