Unable to build SDL_image on Debian Stretch

It seems that upon trying to compile SDL_image on Debian Stretch, I am getting a linker error. I am not sure why, but I think it could be because of GCC 5?

It seems to only effect 64 bit.

I tried to file a bug report, but it seems that I am not getting the confirmation email to create an account…

I am compiling with

export INSTALLDIR=/opt
./autogen.sh
./configure --prefix=$INSTALLDIR --libdir=$INSTALLDIR/lib/$(dpkg-architecture -qDEB_HOST_MULTIARCH)
make

and I am getting the following output

config.status: executing depfiles commands
/bin/bash ./libtool --mode=link gcc -I/usr/include -I/usr/include/libpng12 -g -O2 -D_REENTRANT -I/usr/include/SDL2 -no-undefined -release 2.0 -version-info 0:0:0 -o libSDL2_image.la -rpath /opt/lib/x86_64-linux-gnu IMG.lo IMG_bmp.lo IMG_gif.lo IMG_jpg.lo IMG_lbm.lo IMG_pcx.lo IMG_png.lo IMG_pnm.lo IMG_tga.lo IMG_tif.lo IMG_xcf.lo IMG_xpm.lo IMG_xv.lo IMG_webp.lo -lSDL2
libtool: link: rm -fr .libs/libSDL2_image-2.0.so.0 .libs/libSDL2_image-2.0.so.0.0.0 .libs/libSDL2_image.a .libs/libSDL2_image.lai .libs/libSDL2_image.so
libtool: link: gcc -shared -lSDL2 -Wl,-soname -Wl,libSDL2_image-2.0.so.0 -o .libs/libSDL2_image-2.0.so.0.0.0
libtool: link: (cd “.libs” && rm -f “libSDL2_image-2.0.so.0” && ln -s “libSDL2_image-2.0.so.0.0.0” “libSDL2_image-2.0.so.0”)
libtool: link: (cd “.libs” && rm -f “libSDL2_image.so” && ln -s “libSDL2_image-2.0.so.0.0.0” “libSDL2_image.so”)
libtool: link: ar cru .libs/libSDL2_image.a IMG.o IMG_bmp.o IMG_gif.o IMG_jpg.o IMG_lbm.o IMG_pcx.o IMG_png.o IMG_pnm.o IMG_tga.o IMG_tif.o IMG_xcf.o IMG_xpm.o IMG_xv.o IMG_webp.o
ar: u' modifier ignored sinceD’ is the default (see U') libtool: link: ranlib .libs/libSDL2_image.a libtool: link: ( cd ".libs" && rm -f "libSDL2_image.la" && ln -s "../libSDL2_image.la" "libSDL2_image.la" ) /bin/bash ./libtool --tag=CC --mode=link gcc -I/usr/include -I/usr/include/libpng12 -g -O2 -D_REENTRANT -I/usr/include/SDL2 -o showimage showimage.o libSDL2_image.la -lSDL2 libtool: link: gcc -I/usr/include -I/usr/include/libpng12 -g -O2 -D_REENTRANT -I/usr/include/SDL2 -o .libs/showimage showimage.o ./.libs/libSDL2_image.so -lSDL2 -Wl,-rpath -Wl,/opt/lib/x86_64-linux-gnu showimage.o: In functionmain’:
/srcbuild/SDL_image/showimage.c:96: undefined reference to IMG_LoadTexture' /srcbuild/SDL_image/showimage.c:105: undefined reference toIMG_Load’
/srcbuild/SDL_image/showimage.c:107: undefined reference to `IMG_SavePNG’
collect2: error: ld returned 1 exit status
Makefile:557: recipe for target ‘showimage’ failed
make: *** [showimage] Error 1

Thanks