Makefile: fix clean targets and put all test binaries under BUILDIR/tests/
diff --git a/Makefile b/Makefile
index 76d6db1..1b6286b 100644
--- a/Makefile
+++ b/Makefile
@@ -310,12 +310,15 @@
 	rm -f $(PKGCFGDIR)/$(LIBNAME).pc
 
 clean:
-	rm -f $(LIBOBJ) lib$(LIBNAME).*
+	rm -f $(LIBOBJ)
+	rm -f $(LIBRARY) $(ARCHIVE)
 	rm -f $(PKGCFGF)
+	$(MAKE) -C tests clean
+	rm -f $(BUILDDIR)/tests/lib$(LIBNAME).$(EXT)
+
 	$(MAKE) -C bindings/python clean
 	$(MAKE) -C bindings/java clean
 	$(MAKE) -C bindings/ocaml clean
-	$(MAKE) -C tests clean
 
 
 TAG ?= HEAD