Building apps from the command line will require you to create an application package for your executable.
The easiest way to do this is build a dummy carbon application in project builder with the same name as your executable. Then when you run the configure script of your application have the install paths (e.g. --bindir, --sbindir, etc.) point inside the dummy app. Then make, and make install.
For example, make a cinepaint.app Carbon based project in project builder.
So that when you are running the configure script to build cinepaint add --bindir=/cinepaint.app/Contents/MacOS to the configure input
If you launch your app and it immediately exits, try launching it from the command line e.g. ./MyApp/Contents/MacOS/MyApp, and see if you get different results.