Link with libssl archive file.
Put -ldl last because it is dependancy of crypto and should go after.