improved compilation and generation of prebuilt packages

Signed-off-by: H. Nikolaus Schaller <hns@goldelico.com>