diff --git a/Makefile b/Makefile
index 8f2a976ccdb5aed709feab73badb4728cc803144..dedcd0f23c0c3cf6516c97e08fcf9553b6dcfdd6 100644
--- a/Makefile
+++ b/Makefile
@@ -33,9 +33,10 @@ Makefile.coq: _CoqProject Makefile
 # Install build-dependencies
 build-dep:
 	build/opam-pins.sh < opam.pins
-	opam pin add coq-lambda-rust "$$(pwd)#HEAD" -k git -n -y
 	opam upgrade $(YFLAG) # it is not nice that we upgrade *all* packages here, but I found no nice way to upgrade only those that we pinned
+	opam pin add coq-lambda-rust "$$(pwd)#HEAD" -k git -n -y
 	opam install coq-lambda-rust --deps-only $(YLFAG)
+	opam pin remove coq-lambda-rust
 
 # some fiels that do *not* need to be forwarded to Makefile.coq
 Makefile: ;