make makefiles compatible with CyanogenMod 10

Change-Id: I21ee0ebd5e4ca9b1518e8d719d440d9e77deca48