configure.ac: Actually check the CFLAGS and LDFLAGS returned by ExtUtils::Embed before deciding to compile the Perl plugin.

Some distros like Debian have a separate libperl-dev package needed to link against perl. Without this package, ld complains about -lperl, even though ExtUtils::Embed returns that in ldopts. This change uses AC_TRY_LINK to verify the flags work.

Tested with user Konomi in #hexchat that this causes perl check to fail if libperl-dev isn't present and to succeed if it is. I can't test on openSUSE because it doesn't have a separate devel package for perl.