Use bash from PATH rather than hardcoded in /bin.

E.g. FreeBSD has bash in /usr/local.

http://code.google.com/p/phantomjs/issues/detail?id=597
Use hw.ncpu sysctl on FreeBSD to determine processor count.

Patch by Mike Meyer.

http://code.google.com/p/phantomjs/issues/detail?id=597
-ldl is needed only on Linux, not on all Unices.

In particular on FreeBSD there is no -ldl as the respective
functionality is in -lc.

http://code.google.com/p/phantomjs/issues/detail?id=597