You need to set the env variable NDK_PROJECT_PATH to the root of the project you are building. The root of your NDK project will typically contain the ./jni directory.
export NDK_PROJECT_PATH={root_of_project}
If your JNI code is in a library, then set NDK_PROJECT_PATH to the library project.