[gcc] Why does the order in which libraries are linked sometimes cause errors in GCC?