Pass profile env vars to build commands

Also enable controlling ndebug separately from -g