Here is the solution I had emailed gregrwm in private. I thought others
should be able to see it. See below.

>
> I downloaded the SDL repo. Did a './configure --prefix=/tmp' and 'make' and
> 'make isntall' as usual. This built "SDL2" (the 2 is important here). Then
> I saved the source code I sent you to "sv.c" and then I did the magic:
>
> 'gcc sv.c -I /tmp/include/SDL2/ -L /tmp/lib/ -lSDL2 -lvncclient -Wl,-rpath=/tmp/lib/'
>
> The "./a.out" runs as expected.