Add automatic lib detection with python script, enhance lib listing output when compiling