Are you sure you haven't another libfg.so installed on your system? libfg already is the Video4Linux Frame Grabber interface. Can you try to assign another name to the shared object? E.g.
Code:
gcc -c -fPIC s1.c -o s1.o
gcc -c -fPIC s2.c -o s2.o
gcc -shared -Wl,-soname,libpippo.so.1 -o libpippo.so.1.0.1 s1.o s2.o
ln -s libpippo.so.1.0.1 libpippo.so
gcc app.c -o app -L. -lpippo