Fix libs order when build nested dependencies