I really don't like the hardcoding of system libraries here.  Shouldn't you instead be checking the paths of libraries?