diff --git a/Makefile.orig b/Makefile
index 4edf8cf..1ec6262 100644
--- a/Makefile.orig
+++ b/Makefile
@@ -3,10 +3,10 @@ ST=strip
 datadir  = $(DESTDIR)/usr/share/cqrlog
 bindir   = $(DESTDIR)/usr/bin
 sharedir = $(DESTDIR)/usr/share
-tmpdir   = /tmp
+tmpdir   := $(shell mktemp -d)
 
 cqrlog: src/cqrlog.lpi
-	$(CC) --ws=gtk2 --pcp=$(tmpdir)/.lazarus src/cqrlog.lpi
+	$(CC) --ws=gtk2 --lazarusdir=/usr/share/lazarus --pcp=$(tmpdir)/.lazarus src/cqrlog.lpi
 	$(ST) src/cqrlog
 	gzip tools/cqrlog.1 -c > tools/cqrlog.1.gz
 
