Compiling libraries first to avoid problems while building