Properly handle the hash-style linker check when cross-compiling

Currently the hash-style check fails when cross-compiling,
use AC_RUN_IFELSE to properly handle this case.

checking for --hash-style gcc linker support ...
./configure: line 12119: ./conftest: cannot execute binary file

Change-Id: I77c2d6a859c1c2e6ba42f31b527a9507127d0644
Reviewed-on: https://gerrit.libreoffice.org/11496
Reviewed-by: Caolán McNamara <caolanm@redhat.com>
Tested-by: Caolán McNamara <caolanm@redhat.com>