fix initial installation problem


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@71 a5019735-40e9-0310-863c-91ae7b9d1cf9
diff --git a/Makefile.am b/Makefile.am
index 89aeffd..10c8c16 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -92,5 +92,6 @@
 	$(CC) -Wall -g -O -shared -fpic -o libpthread.so $(libpthread_so_OBJECTS)
 
 install-exec-hook:
+	$(mkinstalldirs) $(DESTDIR)$(valdir)
 	rm -f $(DESTDIR)$(valdir)/libpthread.so.0
-	cd $(DESTDIR)$(valdir) && $(LN_S) libpthread.so libpthread.so.0
+	$(LN_S) libpthread.so $(DESTDIR)$(valdir)/libpthread.so.0