Define AR to help with lua cross-compilation

Closes #997
Use resolv library in Solaris

For some Solaris flavours, the inet_aton in in resolv library.
Not linking this library will introduce link error.

Improves compatability with older Solaris and still
works on new Solaris.

Closes #1092