Assuming you get this error here is an easy fix.
Goto /yourcmdir/vendor/cyanogen/products and edit AndroidProducts.mk. It should look something like this
PRODUCT_MAKEFILES := \
$(LOCAL_DIR)/cyanogen_ace.mk \
…
Remove all the device .mk you don’t need and keep only the one you are compiling and already have the device tree.
Then
. build/envsetup.sh
lunch
make -j4
Et voila!