diff --git a/Makefile.include b/Makefile.include
index 3209ca8c809ee125674a863541dc070119ed4583..4c063a324fa27553306fec1b7bc5e322cc987159 100644
--- a/Makefile.include
+++ b/Makefile.include
@@ -1,11 +1,12 @@
 # set undefined variables
-ifeq ($(strip $(RIOTCPU)),)
-	export RIOTCPU =$(RIOTBASE)/cpu
-endif
+RIOTBASE ?= $(shell dirname "$(lastword $(MAKEFILE_LIST))")
+export RIOTBASE := $(abspath $(RIOTBASE))
 
-ifeq ($(strip $(RIOTBOARD)),)
-	export RIOTBOARD =$(RIOTBASE)/boards
-endif
+RIOTCPU ?= $(RIOTBASE)/cpu
+export RIOTCPU := $(abspath $(RIOTCPU))
+
+RIOTBOARD ?= $(RIOTBASE)/boards
+export RIOTBOARD := $(abspath $(RIOTBOARD))
 
 ifeq ($(strip $(MCU)),)
 	MCU = $(CPU)