diff --git a/libdwarf/Makefile.in b/libdwarf/Makefile.in
index 76add35..1876507 100644
--- a/libdwarf/Makefile.in
+++ b/libdwarf/Makefile.in
@@ -131,8 +131,11 @@ all: @build_shared@ @build_nonshared@
libdwarf.a: dwarf_names.h dwarf_names.c $(OBJS) dwarf_names.o
$(AR) $(ARFLAGS) $@ $(OBJS) dwarf_names.o
-libdwarf.so: dwarf_names.h dwarf_names.c $(OBJS) dwarf_names.o
- $(CC) $(CFLAGS) -shared $(OBJS) dwarf_names.o -o $@
+libdwarf.so: $(SONAME)
+ ln -s $(SONAME) $@
+
+$(SONAME): dwarf_names.h dwarf_names.c $(OBJS) dwarf_names.o
+ $(CC) $(CFLAGS) -shared $(OBJS) -Wl,-soname,$(SONAME) dwarf_names.o -lelf -o $@
none:
echo "do nothing"