automake cleanup: fixing build errors

- Uninitialized field in MonitorLevelDB::Op causes random build errors.
- Order matters; set up automake env before everything else
- Add emergency defs of PRI*64 headers when inttypes.h does not define
  them (which, unfortunately, can happen on some systems).

Signed-off-by: Roald J. van Loon <roaldvanloon@gmail.com>