perl fixes

We're using ExtUtils::Embed to figure out the libraries needed for the
perl module, do not clobber the global LIBS when verifying that libperl
exists. Previously, everything got linked against libperl, which is
undesired.

Also, when detecting libperl, use ExtUtils::Embed to figure out the linker
options, so we can find it even if it is not on the default linker search
path.