diff --git a/src/lib-sieve/Makefile.am b/src/lib-sieve/Makefile.am
index 21336e1be421319e402c7a1394707e3b1bd56d7d..7e0493f2445b9633f5eb747e63c2166aa43bd67e 100644
--- a/src/lib-sieve/Makefile.am
+++ b/src/lib-sieve/Makefile.am
@@ -45,7 +45,7 @@ unfinished_plugins =
 endif
 
 # These are not actual plugins just yet...
-extdir = $(builddir)/plugins
+extdir = $(top_builddir)/src/lib-sieve/plugins
 plugins = \
 	$(extdir)/vacation/libsieve_ext_vacation.la \
 	$(extdir)/subaddress/libsieve_ext_subaddress.la \
diff --git a/src/sieve-tools/Makefile.am b/src/sieve-tools/Makefile.am
index 5ce234292f348dc257aa1a480d74d5b62a92d8c4..7f409bd2249a6465dafff87e3a796fa6b6227665 100644
--- a/src/sieve-tools/Makefile.am
+++ b/src/sieve-tools/Makefile.am
@@ -16,7 +16,7 @@ AM_CPPFLAGS = \
 libs = \
 	$(top_builddir)/src/lib-sieve/libdovecot-sieve.la \
 	$(top_builddir)/src/lib-sieve-tool/libsieve-tool.la \
-	$(builddir)/debug/libsieve_ext_debug.la
+	$(top_builddir)/src/sieve-tools/debug/libsieve_ext_debug.la
 
 libs_ldadd = $(libs) $(LIBDOVECOT_STORAGE) $(LIBDOVECOT_LDA) $(LIBDOVECOT)
 libs_deps = $(libs) $(LIBDOVECOT_STORAGE_DEPS) $(LIBDOVECOT_LDA_DEPS) $(LIBDOVECOT_DEPS)