Try changing your linker command so that the libs come last. Like:
g++ -o binary object1.o objectN.o -llib1 -llibN