[makefile] Change lib and main order, to make compilation work on linux