Suricata 8 pcre2 library not found

I have been looking how to over come this issue but I haven't had any luck.

Trying to compile Surica 8.0.3 package for Openwrt 24.10.5 x86. Configure complains that I don't have pcre2 library but I have it installed. LDFLAGS has been set to the lib path. This error happens when I run make package/suricata/compile from Openwrt SDK folder. But running ./configure from the suricata source folder everything is fine.

checking for zlib.h... yes
checking for inflate in -lz... yes
checking for pcre2_compile_8 in -lpcre2-8... no

   ERROR!  pcre2 library not found, go get it
   from www.pcre.org. Or from packages:
   Debian/Ubuntu: apt install libpcre2-dev
   Fedora: dnf install pcre2-devel
   CentOS/RHEL: yum install pcre2-devel

make[2]: *** [Makefile:70: /home/foureight84/openwrt-sdk-24.10.5-x86-64_gcc-13.3.0_musl.Linux-x86_64/build_dir/target-x86_64_musl/suricata-8.0.3/.configured_889556d2f423f99e091beece9c8d870a] Error 1
make[2]: Leaving directory '/home/foureight84/openwrt-sdk-24.10.5-x86-64_gcc-13.3.0_musl.Linux-x86_64/feeds/packages/net/suricata'
time: package/feeds/packages/suricata/compile#15.82#3.07#18.52
    ERROR: package/feeds/packages/suricata failed to build.
make[1]: *** [package/Makefile:176: package/feeds/packages/suricata/compile] Error 1
make[1]: Leaving directory '/home/foureight84/openwrt-sdk-24.10.5-x86-64_gcc-13.3.0_musl.Linux-x86_64'
make: *** [/home/foureight84/openwrt-sdk-24.10.5-x86-64_gcc-13.3.0_musl.Linux-x86_64/include/toplevel.mk:226: package/suricata/compile] Error 2