Modified the builtin externals dependencies to their libraries to make it work for Ninja. Ensure that the test executables for not  pollute the /bin and /lib directories.