update lib dependence build.  Fix bugs in dependence detection