Your change patches a correctly generated Makefile.in, which means that your changes will be overwritten next time someone runs automake, and it's not something that could be accepted upstream.
The real bug here is that the output of "pkg-config --libs libdaemon" is assigned to btnx_LDFLAGS in src/Makefile.am. This should be btnx_LDADD instead, and then the linker flags will be ordered correctly in src/Makefile.in
Thanks, but this fix is not correct.
Your change patches a correctly generated Makefile.in, which means that your changes will be overwritten next time someone runs automake, and it's not something that could be accepted upstream.
The real bug here is that the output of "pkg-config --libs libdaemon" is assigned to btnx_LDFLAGS in src/Makefile.am. This should be btnx_LDADD instead, and then the linker flags will be ordered correctly in src/Makefile.in