Error trying to compile puae Nintendo Wii

Yes i know it’s not officially supported but i tried to compile puae for Wii with devkitpro, changing the ifneq (,$(findstring wiiu,$(platform))) to wii on Makefile line 127 and it compiled (!) but when i gave ./dist-scripts wii puae_libretro_wii.a i get a bunch of semaphore related errors in the end. I thought maybe it’s something simple so i thought why not ask the experts The error i get is this for a bunch of files (akiko.c cdtv.c and more)

.\libretro_wii.a(gayle.o): In function `process_rw_command’:

gayle.c:(.text+0x3b0): undefined reference to `OSSignalSemaphore’

gayle.c:(.text+0x3fc): undefined reference to `OSWaitSemaphore’

gayle.c:(.text+0x450): undefined reference to `OSSignalSemaphore’

gayle.c:(.text+0x4b0): undefined reference to `OSSignalSemaphore’

gayle.c:(.text+0x4d0): undefined reference to `OSWaitSemaphore’

gayle.c:(.text+0x4f8): undefined reference to `OSWaitSemaphore’

.\libretro_wii.a(gayle.o): In function `process_packet_command’:

gayle.c:(.text+0x658): undefined reference to `OSSignalSemaphore’

gayle.c:(.text+0x6a4): undefined reference to `OSWaitSemaphore’

gayle.c:(.text+0x6f8): undefined reference to `OSSignalSemaphore’

gayle.c:(.text+0x758): undefined reference to `OSSignalSemaphore’

gayle.c:(.text+0x778): undefined reference to `OSWaitSemaphore’

gayle.c:(.text+0x9a8c): undefined reference to `OSResumeThread’

Any help? maybe need some specific LDFLAGS ?