--- a/configure
+++ b/configure
@@ -155,6 +155,7 @@
 host="${host#*-}"
 host_vendor="${host%%-*}"
 host_os="${host#*-}"
+host_ver="${host_os#*-}"
 
 case $host_os in
   beos*)
@@ -397,15 +398,14 @@
 fi
 
 if [ "$pic" = "yes" ] ; then
-    CFLAGS="$CFLAGS -fPIC"
+    CFLAGS="$CFLAGS"
     ASFLAGS="$ASFLAGS -DPIC"
     # resolve textrels in the x86 asm
     cc_check stdio.h -Wl,-Bsymbolic && LDFLAGS="$LDFLAGS -Wl,-Bsymbolic"
 fi
 
 if [ "$debug" != "yes" -a "$gprof" != "yes" ]; then
-    CFLAGS="$CFLAGS -s -fomit-frame-pointer"
-    LDFLAGS="$LDFLAGS -s"
+    CFLAGS="$CFLAGS -fomit-frame-pointer"
 fi
 
 if [ "$debug" = "yes" ]; then
--- a/Makefile
+++ b/Makefile
@@ -67,10 +67,10 @@
 	$(RANLIB) libxavs.a
 
 $(SONAME): .depend $(OBJS) $(OBJASM)
-	$(CC) -shared -o $@ $(OBJS) $(OBJASM) -Wl,-soname,$(SOFLAGS) $(LDFLAGS)
+	$(CC) -shared -o $@ $(OBJS) $(OBJASM) $(SOFLAGS) $(LDFLAGS)
 
-xavs$(EXE): $(OBJCLI) libxavs.a 
-	$(CC) -o $@ $+ $(LDFLAGS)
+xavs$(EXE): $(OBJCLI) $(SONAME) libxavs.a
+	$(CC) -o $@ $(OBJCLI) -L. -lxavs $(LDFLAGS)
 
 xavsvfw.dll: libxavs.a $(wildcard vfw/*.c vfw/*.h)
 	make -C vfw/build/cygwin
