Create OUT_DIR before writing build_number.txt.

Change-Id: I6a84ec59194c48f4291480cb0c94db0da488518c
diff --git a/core/Makefile b/core/Makefile
index c35f744..410fa16 100644
--- a/core/Makefile
+++ b/core/Makefile
@@ -124,7 +124,7 @@
   $(error BUILD_FINGERPRINT cannot contain spaces: "$(BUILD_FINGERPRINT)")
 endif
 
-$(shell echo $(BUILD_FINGERPRINT) > $(PRODUCT_OUT)/build_fingerprint.txt)
+$(shell mkdir -p $(PRODUCT_OUT) && echo $(BUILD_FINGERPRINT) > $(PRODUCT_OUT)/build_fingerprint.txt)
 BUILD_FINGERPRINT_FROM_FILE := $$(cat $(PRODUCT_OUT)/build_fingerprint.txt)
 
 # The string used to uniquely identify the system build; used by the OTA server.